<?php

namespace App\Http\Requests\Admin;

use App\Http\Requests\BaseRequest;
use Illuminate\Foundation\Http\FormRequest;

class SliderRequest extends BaseRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|string|max:20',
            'img' => 'required|string|max:255',
        ];
    }

    public function messages()
    {
        return [
            'title.required' => '请输入轮播图名称',
            'title.max' => '轮播图名称不能超过20个字符',
            'img.required' => '请上传轮播图图片',
            'img.max' => '轮播图图片不能超过255个字符',
        ];
    }
}
